function setup()
    local fio = FileIOClass()
    fio:setPathToDocuments()
    local file = fio:openFile("Obj1.txt")
    if not file then
        error("What!!!")
    end
    local objR = ObjReader(true)
    for lineText in file:lines() do
        objR:readLine(lineText)
    end
    file:close()
    -- objR:readAll(A)
    test1 = objR:genMesh()
    -- test1:setColors(200,200,200,255)
    test1.shader = shader("Documents:Phong Shading")
    test1.shader.normalMatrix = modelMatrix():inverse():transpose()
    test1.shader.lightPosition = vec3(30,40,70)
    test1.shader.modelViewMatrix = modelMatrix() * viewMatrix()
    test1.shader.ambientMaterial = color(31, 31, 31, 255)
    test1.shader.specularMaterial = color(255, 255, 255, 255)
    test1.shader.lightIntensity = color(255, 255, 255, 255)
    test1.shader.shininess = 20
    
    cam = Camera()
    parameter.integer("x",-300,300,0)
    parameter.integer("y",-300,300,0)
    parameter.integer("z",-300,300,0)
    parameter.number("s",0.1,10,1)
end

function draw()
    background(40, 40, 50)
    cam:draw()
    perspective(70, WIDTH/HEIGHT,0.1,2000)
    scale(s)
    test1:draw()
end

function touched(touch)
    cam:touched(touch)
end

O = [[
# WaveFront *.obj file (generated by CINEMA 4D)



g ___

v -100 -100 100

v -100 100 100

v 100 -100 100

v 100 100 100

v 100 -100 -100

v 100 100 -100

v -100 -100 -100

v -100 100 -100



vt 0 1 0

vt 1 0 0

vt 0 0 0

vt 0 0 0

vt 1 1 0

vt 0 1 0

vt 1 1 0

vt 0 0 0

vt 1 0 0

vt 1 0 0

vt 0 1 0

vt 1 1 0

vt 1 0 0

vt 0 0 0

vt 1 1 0

vt 0 1 0

vt 0 0 0
vt 1 0 0
vt 0 1 0
vt 1 1 0

f 3/9 4/12 2/6 1/3 
f 5/13 6/15 4/11 3/8 
f 7/18 8/20 6/16 5/14 
f 1/2 2/5 8/19 7/17 
f 4/10 6/15 8/19 2/4 
f 5/13 3/7 1/1 7/17 
]]

A = [[# Blender v2.75 (sub 0) OBJ File: 'test1.blend'
# www.blender.org
mtllib test1.mtl
o Cone #
v -0.079475 0.148594 0.958359
v 0.115615 0.148594 0.977574
v 0.303208 0.148594 1.034479
v 0.476095 0.148594 1.126889
v 0.627631 0.148594 1.251252
v 0.751994 0.148594 1.402789
v 0.844404 0.148594 1.575675
v 0.901310 0.148594 1.763268
v 0.920525 0.148594 1.958359
v -0.079475 2.148594 1.958359
v 0.901310 0.148594 2.153449
v 0.844404 0.148594 2.341042
v 0.751994 0.148594 2.513929
v 0.627631 0.148594 2.665466
v 0.476095 0.148594 2.789828
v 0.303208 0.148594 2.882238
v 0.115615 0.148594 2.939144
v -0.079476 0.148594 2.958359
v -0.274566 0.148594 2.939144
v -0.462159 0.148594 2.882238
v -0.635046 0.148594 2.789828
v -0.786583 0.148594 2.665465
v -0.910945 0.148594 2.513928
v -1.003355 0.148594 2.341042
v -1.060261 0.148594 2.153448
v -1.079475 0.148594 1.958358
v -1.060261 0.148594 1.763267
v -1.003355 0.148594 1.575674
v -0.910944 0.148594 1.402787
v -0.786581 0.148594 1.251251
v -0.635045 0.148594 1.126888
v -0.462157 0.148594 1.034479
v -0.274564 0.148594 0.977573

vn -0.259900 0.445500 -0.856700
vn 0.087800 0.445500 -0.891000
vn -0.422000 0.445500 -0.789600
vn -0.568000 0.445500 -0.692100
vn -0.692100 0.445500 -0.568000
vn -0.789600 0.445500 -0.422000
vn -0.856700 0.445500 -0.259900
vn -0.891000 0.445500 -0.087800
vn -0.891000 0.445500 0.087800
vn -0.856700 0.445500 0.259900
vn -0.789600 0.445500 0.422000
vn -0.692100 0.445500 0.568000
vn -0.568000 0.445500 0.692100
vn -0.422000 0.445500 0.789600
vn -0.259900 0.445500 0.856700
vn -0.087800 0.445500 0.891000
vn 0.087800 0.445500 0.891000
vn 0.259900 0.445500 0.856700
vn 0.422000 0.445500 0.789600
vn 0.568000 0.445500 0.692100
vn 0.692100 0.445500 0.568000
vn 0.789600 0.445500 0.422000
vn 0.856700 0.445500 0.259900
vn 0.891000 0.445500 0.087800
vn 0.891000 0.445500 -0.087800
vn 0.856700 0.445500 -0.259900
vn 0.789600 0.445500 -0.422000
vn 0.692100 0.445500 -0.568000
vn 0.568000 0.445500 -0.692100
vn 0.422000 0.445500 -0.789600
vn -0.087800 0.445500 -0.891000
vn 0.259900 0.445500 -0.856700
vn 0.000000 -1.000000 0.000000
usemtl None
s off
f 32//1 10//1 33//1
f 1//2 10//2 2//2
f 31//3 10//3 32//3
f 30//4 10//4 31//4
f 29//5 10//5 30//5
f 28//6 10//6 29//6
f 27//7 10//7 28//7
f 26//8 10//8 27//8
f 25//9 10//9 26//9
f 24//10 10//10 25//10
f 23//11 10//11 24//11
f 22//12 10//12 23//12
f 21//13 10//13 22//13
f 20//14 10//14 21//14
f 19//15 10//15 20//15
f 18//16 10//16 19//16
f 17//17 10//17 18//17
f 16//18 10//18 17//18
f 15//19 10//19 16//19
f 14//20 10//20 15//20
f 13//21 10//21 14//21
f 12//22 10//22 13//22
f 11//23 10//23 12//23
f 9//24 10//24 11//24
f 8//25 10//25 9//25
f 7//26 10//26 8//26
f 6//27 10//27 7//27
f 5//28 10//28 6//28
f 4//29 10//29 5//29
f 3//30 10//30 4//30
f 33//31 10//31 1//31
f 2//32 10//32 3//32
f 1//33 2//33 3//33 4//33 5//33 6//33 7//33 8//33 9//33 11//33 12//33 13//33 14//33 15//33 16//33 17//33 18//33 19//33 20//33 21//33 22//33 23//33 24//33 25//33 26//33 27//33 28//33 29//33 30//33 31//33 32//33 33//33
]]